import request from '@/utils/bsinRequest';

// 获取用户列表
export const getCustomerList = (params: any) => {
  return request('/getPageList', {
    serviceName: 'AdminCustomerService',
    methodName: 'getPageList',
    bizParams: {
      ...params,
    },
  });
};

// 获取投票列表
export const getVoteList = (params: any) => {
  return request('/getPageList', {
    serviceName: 'AdminDaoElectionService',
    methodName: 'getPageList',
    bizParams: {
      ...params,
    },
  });
};

// 创建投票
export const createVote = (params: any) => {
  return request('/add', {
    serviceName: 'AdminDaoElectionService',
    methodName: 'add',
    bizParams: {
      ...params,
    },
  });
};

// 修改投票
export const editVote = (params: any) => {
  return request('/edit', {
    serviceName: 'AdminDaoElectionService',
    methodName: 'edit',
    bizParams: {
      ...params,
    },
  });
};

// 发布投票
export const publishVote = (params: any) => {
  return request('/publish', {
    serviceName: 'AdminDaoElectionService',
    methodName: 'publish',
    bizParams: {
      ...params,
    },
  });
};

// 删除投票
export const delVote = (params: any) => {
  return request('/delete', {
    serviceName: 'AdminDaoElectionService',
    methodName: 'delete',
    bizParams: {
      ...params,
    },
  });
};

// 获取投票候选项列表
export const getCandidateList = (params: any) => {
  return request('/getVoteElectionOption', {
    serviceName: 'AdminDaoElectionService',
    methodName: 'getVoteElectionOption',
    bizParams: {
      ...params,
    },
  });
};

// 添加投票候选项
export const addCandidate = (params: any) => {
  return request('/addOption', {
    serviceName: 'AdminDaoElectionService',
    methodName: 'addOption',
    bizParams: {
      ...params,
    },
  });
};

// 删除投票候选项
export const delCandidate = (params: any) => {
  return request('/deleteVoteElectionOption', {
    serviceName: 'AdminDaoElectionService',
    methodName: 'deleteVoteElectionOption',
    bizParams: {
      ...params,
    },
  });
};
